package br.com.kliptus.model.bean;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.maverick.bean.EntityBean;

@Entity
@Table(name = "supplier")
public class SupplierJB extends EntityBean {

	private static final long serialVersionUID = 1L;
	
	private EntityJB entity;
	
	private StatusJB status;
	
	@ManyToOne
	@JoinColumn(name = "status_id", referencedColumnName = "id")
	public StatusJB getStatus() {
		return status;
	}

	public void setStatus(StatusJB status) {
		this.status = status;
	}
	
	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
	public Long getId() {
		return id;
	}

	@OneToOne(cascade=CascadeType.ALL)
	@JoinColumn(name="entity")
	public EntityJB getEntity() {
		return entity;
	}

	public void setEntity(EntityJB entity) {
		this.entity = entity;
	}
	
}